//import angular core
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

//import my components
import { PhotoComponent } from './photo.component';
import { PhotoListComponent } from './photo-list/photo-list.component';
import { PhotoDetailComponent } from './photo-detail/photo-detail.component';

const routes: Routes = [
    {
        path: '',
        component: PhotoComponent,
        children:[
            {
                path:'',
                component: PhotoListComponent
            },
            {
                path:'photo-list',
                component: PhotoListComponent
            },
            {
                path: 'photo-detail/:id',
                component: PhotoDetailComponent
            }
        ]
    }
]

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})

export class PhotoRoutingModule { }
 